UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qanzv8dXQ6no6wC0gGSRwdkJqkVkXlfhEC65YwqdFUw='
WHERE
key_id = '20ceefaa26ba1cac6ef0cbe81c82c9a1f3a22b1a13648ccc63357e70676c7b71'
AND (
token = 'qanzv8dXQ6no6wC0gGSRwdkJqkVkXlfhEC65YwqdFUw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)