UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wqz+z6/sN2c1uNuibLC+ZbFMwoeS5xdyyV7N1/xfSnI=' 
WHERE 
  key_id = '29efe02d8f8c637f4c774b91d29ca54d226f5c4c4bc301e6a03baa55427a17a5' 
  AND (
    token = 'wqz+z6/sN2c1uNuibLC+ZbFMwoeS5xdyyV7N1/xfSnI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050