UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k1wUgSrMQJdTMCbEXL72xratgDV1N9ru8/uClEzweO0=' 
WHERE 
  key_id = '9db47a5db8fe694c1bfabe3a84c4491a936ff06493ff0c5a68ea2c10ef623d5f' 
  AND (
    token = 'k1wUgSrMQJdTMCbEXL72xratgDV1N9ru8/uClEzweO0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050