UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cjhBhGdPEhybgZ7gzjIaqV9Q3L0sKM5o0z8SDHfvNUo='
WHERE
key_id = '37eb21d7458ce33644b105a1ecc64a82e976a4027438be2cb0646323ad1dc174'
AND (
token = 'cjhBhGdPEhybgZ7gzjIaqV9Q3L0sKM5o0z8SDHfvNUo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)