UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cS1f6AutNVHMjUuC6bBo1SICXBOldWGrRWIIVLYcRVQ=' 
WHERE 
  key_id = '6e88c0d9cba590f8dec4904ba4072bee1386df702e4804f01b21a65fd0563ae5' 
  AND (
    token = 'cS1f6AutNVHMjUuC6bBo1SICXBOldWGrRWIIVLYcRVQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028