UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9PlJ3bAcCzeJTym5OE5JYB9WCGuzd+Acb3miCFqjL10='
WHERE
key_id = 'db5cb6f32a2e1f21d1f27a749638e25205513267fa936cf08a1fe64499250477'
AND (
token = '9PlJ3bAcCzeJTym5OE5JYB9WCGuzd+Acb3miCFqjL10='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)