UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AUBUYhdlwxF2q1Xtso13uPgRpnhNEMwcuCvyqq+RQr0='
WHERE
key_id = 'afbf90e6d2724b203f388be35ba86f20b5e62eba7ba85d380bcb026385825be5'
AND (
token = 'AUBUYhdlwxF2q1Xtso13uPgRpnhNEMwcuCvyqq+RQr0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)