UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4IkTZL0hE69LlKl4MCVH5Gjn6ReSrnEsu+7DAx2FHj0=' 
WHERE 
  key_id = '5aeb218e24f30269a8e32bdc9bd48c405ed56eb990222729afb5d3162781700d' 
  AND (
    token = '4IkTZL0hE69LlKl4MCVH5Gjn6ReSrnEsu+7DAx2FHj0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025