UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SFF/RhkI/LjYgweEkkgD0hpJ/mYd+hJJbsZKtwcv4+s=' 
WHERE 
  key_id = '68a263ed638e8906fdb9711b877d9f8ed03c429706af5fa610aae331f6a7f94c' 
  AND (
    token = 'SFF/RhkI/LjYgweEkkgD0hpJ/mYd+hJJbsZKtwcv4+s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050