UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vb7KEc8lGyZpRUfvH0lHu8UBmGH5tH9WMczQiapr/P0='
WHERE
key_id = '4e88a19b403a8d001ea06e0c94fa5803882e705852e05b59a4b7740275064fd3'
AND (
token = 'vb7KEc8lGyZpRUfvH0lHu8UBmGH5tH9WMczQiapr/P0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)