UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hlx1nuRFRapTMnwE0GMkY5GIEz/QMwg5Z9NlmMUPQ+Y=' 
WHERE 
  key_id = 'f5a3fdeeeb47ac5897bb20fdc99ccd5a9d35414925a0ab29241a323960e46e86' 
  AND (
    token = 'hlx1nuRFRapTMnwE0GMkY5GIEz/QMwg5Z9NlmMUPQ+Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030