UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1iay4WE7brZntL7+8bTxsNvwTukN49ZZXiW4bk4MIs4=' 
WHERE 
  key_id = '2b003e62abd9c76f8bdc4b5564b81e3aa75729fcf74507ac89bec2cd6e6517a6' 
  AND (
    token = '1iay4WE7brZntL7+8bTxsNvwTukN49ZZXiW4bk4MIs4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032