UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4MjQnskPbV+Ecdef9gAVIfTEEM9AnMClOvLeZl1QOXg='
WHERE
key_id = 'ea678921f03ae1c1cc883cce82a3abfbcceb9ee930c8c73b3105d95de6be2e43'
AND (
token = '4MjQnskPbV+Ecdef9gAVIfTEEM9AnMClOvLeZl1QOXg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)