UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bGIFGlcWKmkrXH9XsJ1LpYzplJZQPwp1gRVd6Sp0/ds=' 
WHERE 
  key_id = '9113127fd03ab54741b82fe4217e793c89a3c495089d22eb3eb9a9978af76a9f' 
  AND (
    token = 'bGIFGlcWKmkrXH9XsJ1LpYzplJZQPwp1gRVd6Sp0/ds=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054