UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6HciTC2XumHHg8KDrWGG0RW1jo+QRMPX4woQvigO7FQ='
WHERE
key_id = '4265b9bd2159384710e6b4d8168a1fea4a700c038202b393321e362aa938b4be'
AND (
token = '6HciTC2XumHHg8KDrWGG0RW1jo+QRMPX4woQvigO7FQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)