UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XSa/aMJy3Ig3pPMERwJkzzs9+MFXkg0nceZpNYv6Ofs=' 
WHERE 
  key_id = '62a086edf2c0857369788bea4cc7fcbae9b5d985de8392c7b3ca03ffe6559087' 
  AND (
    token = 'XSa/aMJy3Ig3pPMERwJkzzs9+MFXkg0nceZpNYv6Ofs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041