UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XB1AssVVG73gxaQBPmVNwfHJUnRiBA8JqT3BT86av8M='
WHERE
key_id = '6e66516ab2b42894af699769ab8e1ec0f22b2d173d6d3255da4673e731bcfde2'
AND (
token = 'XB1AssVVG73gxaQBPmVNwfHJUnRiBA8JqT3BT86av8M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)