UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+4tGn8trTgcOt4JJY6ByMWrPL6aHNszgo6mmItOhyKo=' 
WHERE 
  key_id = 'db1a842ba219bed431e7d7881f92a59f55195461d4888295736337ff7e469a52' 
  AND (
    token = '+4tGn8trTgcOt4JJY6ByMWrPL6aHNszgo6mmItOhyKo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021