UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ioBiqjVOvwYzV0zOJXjLqC9pbHS7ZqjDSPRB7cwLjS4=' 
WHERE 
  key_id = '99743e73883919f544c96886386cca6a79a9c4acac3ec76fa31ca6589853a82a' 
  AND (
    token = 'ioBiqjVOvwYzV0zOJXjLqC9pbHS7ZqjDSPRB7cwLjS4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037