UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2HZ+9EhXsjNkvnZDKq7bu/a+TlrF/3zDR/WgmoU4qEc='
WHERE
key_id = '1e8c2df53a42fe96815373cccd437f55add7e517a7a9b840127bd28560924ec9'
AND (
token = '2HZ+9EhXsjNkvnZDKq7bu/a+TlrF/3zDR/WgmoU4qEc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)