UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ul+RzMudmvw4C3AWcjU27RJT9pp4GPvdrrcAY34jzaI=' 
WHERE 
  key_id = '44df3fdb8983d54c8ae8e31c70b95087bae376216f1ce3f38514a1930434330e' 
  AND (
    token = 'ul+RzMudmvw4C3AWcjU27RJT9pp4GPvdrrcAY34jzaI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046