UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VeHx0WOC7FwduOyaTJW8DxlR8rIiWBnZ/clucwIKKMw='
WHERE
key_id = 'f7113372b83178ac7ccd2182792946a076ab143279e5f6a2360dcb6c41d3ee4f'
AND (
token = 'VeHx0WOC7FwduOyaTJW8DxlR8rIiWBnZ/clucwIKKMw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)