UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cFC7N8A9pjU/6qug0KPJhlj5D6PrjctCFD5b9/CFFik='
WHERE
key_id = 'e152e34e687a7707469150761dbc850d3d26d9d4ca6551c5f12127a4698d1c23'
AND (
token = 'cFC7N8A9pjU/6qug0KPJhlj5D6PrjctCFD5b9/CFFik='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)