UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6gq83ggEn7ugo1nXvj+1EhxVtn2HObo0JaY9YbEW4Oc=' 
WHERE 
  key_id = '7423fb39f3951f3acb0620c74f47f17411c031dc5aa5e85c8d867d3da34e6f6d' 
  AND (
    token = '6gq83ggEn7ugo1nXvj+1EhxVtn2HObo0JaY9YbEW4Oc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026