UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uGEhFMOX6BBqT8VS9fqhNDmPQT9b7PNib+L4pxMxcY0=' 
WHERE 
  key_id = 'b9d6c0a101c75591d2ce7cc43d7b822a7e4495b9215493a19a2c8ccbb468ed9e' 
  AND (
    token = 'uGEhFMOX6BBqT8VS9fqhNDmPQT9b7PNib+L4pxMxcY0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00075