UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0jMhIKw+Cc1X6X5e3hfGlLQaR9lI76kaXdQkh0G/wd4=' 
WHERE 
  key_id = 'e168186a24c330a188067b8be094d6a208f8cceb3b17544263202f12ac5edbda' 
  AND (
    token = '0jMhIKw+Cc1X6X5e3hfGlLQaR9lI76kaXdQkh0G/wd4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030