UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Nr/7cmVerxGmIn0dzHTM9K2SEz+LlhiG5ffjpGYw74c='
WHERE
key_id = '80ee3889f84779e2177c96cbcbd051fb66df9441ab80a9a8f4975cbba4e821d3'
AND (
token = 'Nr/7cmVerxGmIn0dzHTM9K2SEz+LlhiG5ffjpGYw74c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)