UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pCD4Nte0WgyUOwRA2J+XvygldQr+LjrodQx0op4k2zY='
WHERE
key_id = 'd6fb3b9577c034883026d76700a38efc02f06cadc6ca12dafb40c3f8313e4e6d'
AND (
token = 'pCD4Nte0WgyUOwRA2J+XvygldQr+LjrodQx0op4k2zY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)