UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mkgFUFKKWa+8U7REAtiEkUgW913ecW8+8Q4tjsH6Oi0=' 
WHERE 
  key_id = '3502414030e7f5427bd7f54c07c40be80fb75d0aafc6b56d54c3a6e1bbbbd9c4' 
  AND (
    token = 'mkgFUFKKWa+8U7REAtiEkUgW913ecW8+8Q4tjsH6Oi0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036