UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zN9gPOmyjFJmFDz51Tj6vT3kFxMsj++XuJ6sbP8/674=' 
WHERE 
  key_id = '0c9863e3714163b41b20200a912f33a05aaf45c4ca5b0bced1b563e3e830e425' 
  AND (
    token = 'zN9gPOmyjFJmFDz51Tj6vT3kFxMsj++XuJ6sbP8/674=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052