UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HFGSxqUIl1N+Y0Tg4zjOzGDz4fLZRdxQ/f08SnK+pQw=' 
WHERE 
  key_id = '0d78f3cb390dd755d874884446b0214a35855143129ace9b7e12edf0bd51892a' 
  AND (
    token = 'HFGSxqUIl1N+Y0Tg4zjOzGDz4fLZRdxQ/f08SnK+pQw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020