UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XqeM/ltd3Zo/0QsqjWQhGlyKfu+n3xcQECX/XqfzIGw='
WHERE
key_id = '080e0f51576c09017b1ffa6411269ed2a3fd63b0a652c030af1e1ca89bf31ae7'
AND (
token = 'XqeM/ltd3Zo/0QsqjWQhGlyKfu+n3xcQECX/XqfzIGw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)