UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mX5vxT61TRdTd/mShLnqh8Zn8MlyFRdjOrxFoohq+yk='
WHERE
key_id = '35658116fd1ae921fcabaff4052ed8d297d14fc402eadab3a61ebc4c3520a276'
AND (
token = 'mX5vxT61TRdTd/mShLnqh8Zn8MlyFRdjOrxFoohq+yk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)