UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A1ceXx0qtktG4ZtUPYRI3oHkX657olQYI65aWaFOVlQ='
WHERE
key_id = '5a93b5b11c72a0a5484a0a6490473e1646df7727842bd0fe9526fc26bdaa0d39'
AND (
token = 'A1ceXx0qtktG4ZtUPYRI3oHkX657olQYI65aWaFOVlQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)