UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WHqsoXTAl6ISuLnrg0Cpe3ql/IbdFrhvSysBxJlb/nw='
WHERE
key_id = '6c9c0ddc7b915d7e99e1b273d7bb1350a679f89da85899c006937a73afec0860'
AND (
token = 'WHqsoXTAl6ISuLnrg0Cpe3ql/IbdFrhvSysBxJlb/nw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)