UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gsb+/jo6n6Qds+v3UAfk59F821eaFihnj7V4G1oMNlM=' 
WHERE 
  key_id = '7dd294a6d050f7bbad8317602b29d8a3ca501df88db40035957ba958f92a0f0f' 
  AND (
    token = 'gsb+/jo6n6Qds+v3UAfk59F821eaFihnj7V4G1oMNlM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039