UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a9xy2JNQZyeqiipC52xjVeil6A9vqY5zxw7JPP3IoIk='
WHERE
key_id = '08b94f5fe5848fcdd35984986c7cec7ccda0061f2cb908094ca24387e87cc479'
AND (
token = 'a9xy2JNQZyeqiipC52xjVeil6A9vqY5zxw7JPP3IoIk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)