UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rzCo7F9CFMi/8Buo8P8cha3JLDluHEFDJynhZRsdQdk=' 
WHERE 
  key_id = '27559f8d888cdd9e8b52094841ed588030f4a7a33cb55926026d0bf21a7d98fc' 
  AND (
    token = 'rzCo7F9CFMi/8Buo8P8cha3JLDluHEFDJynhZRsdQdk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032