UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RUibWq7cnOPNGfdNSfUrwvSAwrCvbeA/cvXqXICwD6w=' 
WHERE 
  key_id = '972f0467fb2dc53027a5aa2b0de4c5294d8086218dcb2aba35cc7c4b4c214e00' 
  AND (
    token = 'RUibWq7cnOPNGfdNSfUrwvSAwrCvbeA/cvXqXICwD6w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025