UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ybVZ1FIJtUoaBm+zHSGeKRJXJ5okKKNxGmDawoXuFHc=' 
WHERE 
  key_id = '369b6d3efdb20a0aa93dbebeb8686ad80dddb5ce32fa4878b713c2b485c81fee' 
  AND (
    token = 'ybVZ1FIJtUoaBm+zHSGeKRJXJ5okKKNxGmDawoXuFHc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046