UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zE+eCi6joHYdDCB8aHXQT5MM3NFd4VFbV5n0yofb2Jc='
WHERE
key_id = '992446739a29a4d1d89eb7e6a98171e8ae9d2c2f8644175a6d97a5a61672e708'
AND (
token = 'zE+eCi6joHYdDCB8aHXQT5MM3NFd4VFbV5n0yofb2Jc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)