UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/a1glOARUz6tCJGUKZwRQSW5ZzJtuqF09VcPU04E9cQ=' 
WHERE 
  key_id = '71ff5011c4661923f9ec1de5179d0ef65bc30f4348df7afaa736be4f1021356d' 
  AND (
    token = '/a1glOARUz6tCJGUKZwRQSW5ZzJtuqF09VcPU04E9cQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047