UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RYOZUSRKVKsdlY/TnpZ6Aq3KIRs7V27i21EFrmBlFa0=' 
WHERE 
  key_id = 'ab3554e03dd9ea12589739cb3ad81130f9bd6fe46551181dee3228fc3b774689' 
  AND (
    token = 'RYOZUSRKVKsdlY/TnpZ6Aq3KIRs7V27i21EFrmBlFa0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023