UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GgYdXFkb0wmFAkhEom4ARE23TyZ8mohYyaxUPT6MUCY='
WHERE
key_id = '8472c0cd0275db87d9b93c65da31b65013cafa8ea2d8f257aa629c85612db6e6'
AND (
token = 'GgYdXFkb0wmFAkhEom4ARE23TyZ8mohYyaxUPT6MUCY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)