UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yTdwgsnO348YkRA5LEEYPghJprUubiLPGjCUZVpyAqQ=' 
WHERE 
  key_id = '7212b96afaec138c6049f111a945f575a65b9c5dffaedfc60f85c27bef2decf1' 
  AND (
    token = 'yTdwgsnO348YkRA5LEEYPghJprUubiLPGjCUZVpyAqQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018