UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'P1LdZ9M6K94qw0uqiHq9dTQ1Flrs9n1V3FBJpO/4RjE='
WHERE
key_id = '9391c3698a8d42d37dd7b54b3e57528d9019bc9c2f934f4e3c0fbc059364b7e2'
AND (
token = 'P1LdZ9M6K94qw0uqiHq9dTQ1Flrs9n1V3FBJpO/4RjE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)