UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tlbEzGGV5uTcHLlSE7zn+r2+eH2tggJCG7hXtNYF8Gg='
WHERE
key_id = '7d4b3073dd37c8c2273f4ff10fa7e6dfa0400ba09ed517beb948e8266c174d6d'
AND (
token = 'tlbEzGGV5uTcHLlSE7zn+r2+eH2tggJCG7hXtNYF8Gg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)