UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UWC+7HkYjLmkCC8NVqwfwQXbGc6JL+c1YOMmGJOQavQ='
WHERE
key_id = 'ccb6a12e166fed28b44ba1be7ebc27a01b5f35b9e42a07a5f860469c0b234d30'
AND (
token = 'UWC+7HkYjLmkCC8NVqwfwQXbGc6JL+c1YOMmGJOQavQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)