UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MxJbL7YYIOweg37IrSRLWTQNN4a11LAK7V2ZdcWAmwY='
WHERE
key_id = 'cf393eb647fed6af26d2ce8dceeadeccf9167a0b095beae104fbaba9333b852d'
AND (
token = 'MxJbL7YYIOweg37IrSRLWTQNN4a11LAK7V2ZdcWAmwY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)