UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qnNYkLc/8zMR6grp9yosocPziEqhbCIYNVecEkz2wEw=' 
WHERE 
  key_id = '5b9a89c30c882d2ef1bbc7c96d10c639da0111fd7c54b49ae7140f73c8c04967' 
  AND (
    token = 'qnNYkLc/8zMR6grp9yosocPziEqhbCIYNVecEkz2wEw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024