UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/1usQ8+DwGQdO2QpOxjAuHDDJxNouFRqY3fHRXzRcA8='
WHERE
key_id = '7966761d3b8dca28406194e8662125656bc5db46019adc8017b21698c38fabc4'
AND (
token = '/1usQ8+DwGQdO2QpOxjAuHDDJxNouFRqY3fHRXzRcA8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)