UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lMERJ+S/buDyTSIAZFQ1cQHFHjb4TT0J1Paos3ADC/8='
WHERE
key_id = '783285b7fd34bed97612bf7c40ecc0c119f717ac4710c29d4eb70174272945a9'
AND (
token = 'lMERJ+S/buDyTSIAZFQ1cQHFHjb4TT0J1Paos3ADC/8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)