UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zmg45ucgCpj4r/gkZGghieKl0xf4hwaxs8TVjr2cJwE='
WHERE
key_id = '3aed5ea38dd99daba74001a39cfc4fa9cca9cbf2eba5d7270d64fd5ca048238a'
AND (
token = 'zmg45ucgCpj4r/gkZGghieKl0xf4hwaxs8TVjr2cJwE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)